import { apiClient } from './axios';

// 认证相关接口
export const authApi = {
  // 用户登录
  login: (credentials: { username: string; password: string }) => {
    return apiClient.post('/auth/login', credentials);
  },

  // 获取当前用户信息
  getCurrentUser: () => {
    return apiClient.get('/auth/me');
  },

  // 修改密码
  changePassword: (data: { old_password: string; new_password: string }) => {
    return apiClient.post('/auth/change-password', data);
  },

  // 刷新令牌
  refreshToken: () => {
    return apiClient.post('/auth/refresh');
  },

  // 退出登录
  logout: () => {
    return apiClient.post('/auth/logout');
  }
};